class Emp :
    number = 0
    def __init__(self,name) -> None:
        self.name = name
        Emp.number += 1
    @classmethod
    def count_num(cls) :
        print("个数:",cls.number)
e1 = Emp("Z3")
e2 = Emp("Z2")
e3 = Emp("Z1")
e1.count_num()
Emp.count_num()
        